#ifndef RELAYITEM_H
#define RELAYITEM_H

#include "circuitcomponent.h"

class Relay : public CircuitComponent
{
    Q_OBJECT
public:
    explicit Relay(bool closed = false, QGraphicsItem *parent = nullptr);

    QPointF inputPort() const override;
    QPointF outputPort() const override;
    bool isClosed() const { return m_closed; }
    void setClosed(bool closed);
    void setText(const QString &text);
    void setEnable(bool enable);

protected:
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
    QRectF boundingRect() const override;

private:
    bool m_closed;
    QString m_text="";
    bool m_enable = false;

Q_SIGNALS:
    void changeStateMainZ(bool state);
    void changeStateMainF(bool state);
    void changeStatePrevC(bool state);
    void changeStateFastC(bool state);
};


#endif // RELAYITEM_H
